package com.foreknow.demo8;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;


public class Demo1 {
    public void method1(Pet pet) {
        pet.eat();
    }

    public Pet method2() {
        Pet p = new Dog();
        return p;
    }

    public Pet[] method3() {
        Pet[] pets = new Pet[3];
        return pets;
    }
    public static void main(String[] args) throws FileNotFoundException {
        FileReader fr = new FileReader("");
        BufferedReader bf = new BufferedReader(fr);
        Demo1 demo1 = new Demo1();
        Pet[] pets = demo1.method3();
        for(int i = 0;i<pets.length;i++){
            Pet p = pets[i];
            System.out.println(p.getName());
        }
    }
}
